{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<h1 align=\"center\", style=\"color:green\">Matplotlib Tutorial: Subplots</h1>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Container object of 4 artists>"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAACFCAYAAACwoTTBAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAC4FJREFUeJzt3X+sXGWdx/H317aoK0rBXpW0xYux\n0cWNCnZrXTaG2A0WMC2JkNTsat1gGiMkmF3jlt1Eoy5Z3T+UuLpuWIqpP3ZB6w8qStguP/7YZKm0\n/KiLFbkqLg1I0QJVN4tWv/5xngtjn7l3Zpi5c6bh/Upu7jnPeeY533k6937uOXPmNDITSZI6Pavt\nAiRJk8dwkCRVDAdJUsVwkCRVDAdJUsVwkCRVDAdJUsVwkCRVDAdJUmVx2wXMZ9myZTk9Pd12GZJ0\nTNm7d+9PM3NqmDEmOhymp6fZs2dP22VI0jElIn487BieVpIkVQwHSVLFcJAkVSb6PQfpWDa99Ztt\nl9Cq+z96XtslaAgeOUiSKoaDJKliOEiSKoaDJKliOEiSKoaDJKliOEiSKoaDJKliOEiSKoaDJKli\nOEiSKt5bSdJE8t5U7d6byiMHSVLFIwfNyb/cvKuonrk8cpAkVQwHSVLFcJAkVQwHSVKl73CIiEUR\ncWdEXF/WT42I3RFxX0RcG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K/PVb36DzB7R6tdKf0hx27eOpy6vOpTnPfhPNpVw3ASeV/i+hSefD\nwGNl+QXAq2kuwdxH80P5gY59fBjYUJb/geaSsbtpLiF75TjqO2rMs+i4YuCo+p5Dc0g4Q3Np7ssm\nrL5W5o/mnPTdPHWp8t917OPdwLvLctD8R1I/oLmsdPWE1XdJx/zdBvzJuP59gdcCe8pYX+epyyNb\nn78B6mtz/v6A5hfpCUftY1Lmr5/6Bpq/zPT2GZKkWutvSEuSJo/hIEmqGA6SpIrhIEmqGA6SpIrh\nIEmqGA6SpMrvACIkdR2GuvabAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1781d4c96d8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "year=[2014,2015,2016,2017]\n",
    "income=[4000,4500,5300,4600]\n",
    "expense=[2800,3000,2800,3400]\n",
    "\n",
    "plt.subplot(2,1,1)\n",
    "# income.set_title('Income')\n",
    "plt.bar(year,income)\n",
    "\n",
    "\n",
    "# plt.subplot(2,1,2)\n",
    "# plt.bar(year,expense,color='green')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
